package com.czk.controller;

import com.czk.entity.StatusCode;
import com.czk.entity.Result;
import com.czk.service.SkuService;
import com.czk.model.TbSku;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/10/20 16:56
 */
@RestController
@RequestMapping("/sku")
public class SkuController {
    @Resource
    private SkuService skuService;

    @GetMapping("{skuId}")
    public Result<TbSku> findById(@PathVariable("skuId") String skuId) {
        TbSku tbSku = skuService.findById(skuId);
        return new Result<>(true, StatusCode.OK, "查询成功", tbSku);
    }
}
